home *** CD-ROM | disk | FTP | other *** search
- Path: news.logicon.com!newsmaster@klee
- From: kkolda@logicon.com (Kenneth D. Kolda)
- Newsgroups: comp.lang.c++
- Subject: Re: Help Please
- Date: 11 Apr 1996 21:04:41 GMT
- Organization: Logicon Operating Systems
- Message-ID: <4kjs59$fhi@piper.logicon.com>
- References: <4ki39v$30s@daisy.flex.com.au>
- NNTP-Posting-Host: 137.51.122.161
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.2
-
- In article <4ki39v$30s@daisy.flex.com.au>, cobweb@flex.com.au says...
- [snip]
- > printf("\n 4. Mars 9. Pluto " );
- > printf("\n 5. Jupiter 10. The Moon");
- >
- > printf("\n\nPlease select a number: ");
- > scanf(" %c", &choice);
-
- Make "choice" and int and then change this scanf to:
- scanf(" %d", &choice);
-
- In your switch statement, change your cases to:
-
- case (1) : ...
-
- etc.
-
- As for weight and total, float should be sufficient.
- As for do...while or just while, 6 of one, half dozen ...
-
- > switch (choice)
- > { case ('1') : total = (weight * .4);
- > printf("On Mercury you would weigh %.2f Pounds",
-
- Ken Kolda
-
-